﻿using System;
using System.ServiceModel;
using CID.Execution.Support.DeploymentInitiation;

namespace CID.Execution.Controller.DeploymentInitiation
{
    [ServiceContract(Namespace = "http://cid.org/DeploymentInitiation/Web")]
    public sealed class WebDeploymentInitiationService : DeploymentInitiationServiceBase
    {
        public WebDeploymentInitiationService() : base() { }

        [OperationContract]
        public Guid InitiateDeploymentByIds(int releaseId, int targetEnvironmentId, int responsibleId)
        {
            return DeploymentInitiator.InitiateDeployment(releaseId, targetEnvironmentId, responsibleId);
        }

        [OperationContract]
        public Guid InitiateDeploymentByNames(string releaseName, string targetEnvironmentName, string responsibleUserName)
        {
            return DeploymentInitiator.InitiateDeployment(releaseName, targetEnvironmentName, responsibleUserName);
        }
    }
}
